﻿<UserControl x:Class="ViewSwitchingNavigation.Contacts.Views.ContactAvatarView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" 
    d:DataContext="{d:DesignData /SampleData/ContactSampleData.xaml}">
    <UserControl.Resources>
        <DataTemplate x:Key="ContactAvatarTemplate">
            <Grid>               
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>                  
                </Grid.RowDefinitions>                
                <Image Source="{Binding AvatarUri}" Width="32" Height="32" /> 
                <TextBlock Text="{Binding Name}" FontWeight="Bold" FontSize="14" Grid.Row="1" />              
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <ContentControl Content="{Binding}" ContentTemplate="{StaticResource ContactAvatarTemplate}"/>
    </Grid>
</UserControl>
